Current Location: Home> Function Categories> sqrt

sqrt

Square root
Name:sqrt
Category:math
Programming Language:php
One-line Description:Square root.

Definition and usage

sqrt() function returns the square root of a number.

Example

In this example, we will return the square root of different numbers:

 <?php
echo ( sqrt ( 0 ) ) ;
echo ( sqrt ( 1 ) ) ;
echo ( sqrt ( 9 ) ) ;
echo ( sqrt ( 0.64 ) ) ;
echo ( sqrt ( - 9 ) ) ;
?>

Try it yourself

grammar

 sqrt ( x )
parameter describe
x Required. A number.

illustrate

Returns the square root of x .

Similar Functions
  • Convert decimal to binary decbin

    decbin

    Convertdecimaltobina
  • Hyperbolic sine sinh

    sinh

    Hyperbolicsine
  • Generate a random integer rand

    rand

    Generatearandominteg
  • Returns the remainder of the floating point number of division fmod

    fmod

    Returnstheremaindero
  • Calculate the oblique length of a straight triangle hypot

    hypot

    Calculatetheobliquel
  • Convert decimal to hexadecimal dechex

    dechex

    Convertdecimaltohexa
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Round the division result intdiv

    intdiv

    Roundthedivisionresu
Popular Articles